import '../item_style.dart';
import '../line_style.dart';
import '../tooltip.dart';
import 'series.dart';

import 'package:json_annotation/json_annotation.dart';

part 'sankey_series.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SanKeyEmphasis {
  var focus;
  var blurScope;
  SeriesLabel? label;
  ItemStyle? itemStyle;
  LineStyle? lineStyle;

  SanKeyEmphasis(
      {this.focus, this.blurScope, this.label, this.lineStyle, this.itemStyle});

  factory SanKeyEmphasis.fromJson(Map<String, dynamic> json) =>
      _$SanKeyEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$SanKeyEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SanKeyBlurSelectEmphasis {
  SeriesLabel? label;
  ItemStyle? itemStyle;
  LineStyle? lineStyle;

  SanKeyBlurSelectEmphasis({this.label, this.lineStyle, this.itemStyle});

  factory SanKeyBlurSelectEmphasis.fromJson(Map<String, dynamic> json) =>
      _$SanKeyBlurSelectEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$SanKeyBlurSelectEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SanKeyData {
  var name;
  var value;
  var depth;
  ItemStyle? itemStyle;
  SeriesLabel? label;
  SanKeyBlurSelectEmphasis? emphasis;
  SanKeyBlurSelectEmphasis? blur;
  SanKeyBlurSelectEmphasis? select;
  Tooltip? tooltip;

  SanKeyData(
      {this.name,
      this.value,
      this.depth,
      this.itemStyle,
      this.label,
      this.emphasis,
      this.blur,
      this.select,
      this.tooltip});

  factory SanKeyData.fromJson(Map<String, dynamic> json) =>
      _$SanKeyDataFromJson(json);

  Map<String, dynamic> toJson() => _$SanKeyDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SanKeyLink {
  var source;

  var target;
  var value;
  LineStyle? lineStyle;
  SanKeyBlurSelectEmphasis? emphasis;
  SanKeyBlurSelectEmphasis? blur;
  SanKeyBlurSelectEmphasis? select;

  SanKeyLink(
      {this.source,
      this.target,
      this.value,
      this.lineStyle,
      this.emphasis,
      this.blur,
      this.select});

  factory SanKeyLink.fromJson(Map<String, dynamic> json) =>
      _$SanKeyLinkFromJson(json);

  Map<String, dynamic> toJson() => _$SanKeyLinkToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SanKeyLevel {
  var depth;
  SeriesLabel? label;
  LabelLine? labelLine;
  ItemStyle? itemStyle;
  SanKeyEmphasis? emphasis;
  SanKeyBlurSelectEmphasis? blur;
  SanKeyBlurSelectEmphasis? select;

  SanKeyLevel(
      {this.label,
      this.labelLine,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.select});

  factory SanKeyLevel.fromJson(Map<String, dynamic> json) =>
      _$SanKeyLevelFromJson(json);

  Map<String, dynamic> toJson() => _$SanKeyLevelToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SanKeySeries {
  var type = 'sankey';
  var id;

  var name;

  var zlevel;
  var z;
  var left;
  var top;
  var right;
  var bottom;
  var width;
  var height;

  var nodeWidth;
  var nodeGap;
  var nodeAlign;
  var layoutIterations;
  var orient;
  var draggable;
  List<SanKeyLevel>? levels;

  SeriesLabel? label;
  LabelLayout? labelLayout;
  ItemStyle? itemStyle;
  LineStyle? lineStyle;
  SanKeyEmphasis? emphasis;
  SanKeyBlurSelectEmphasis? blur;

  SanKeyBlurSelectEmphasis? select;
  var selectedMode;
  List<SanKeyData>? data;
  var nodes;

  List<SanKeyLink>? links;

  var edges;
  var silent;
  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;
  Tooltip? tooltip;

  SanKeySeries(
      {this.id,
      this.name,
      this.zlevel,
      this.z,
      this.left,
      this.top,
      this.right,
      this.bottom,
      this.width,
      this.height,
      this.nodeWidth,
      this.nodeGap,
      this.nodeAlign,
      this.layoutIterations,
      this.orient,
      this.draggable,
      this.levels,
      this.label,
      this.labelLayout,
      this.itemStyle,
      this.lineStyle,
      this.emphasis,
      this.blur,
      this.select,
      this.selectedMode,
      this.data,
      this.nodes,
      this.links,
      this.edges,
      this.silent,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate,
      this.tooltip});

  factory SanKeySeries.fromJson(Map<String, dynamic> json) =>
      _$SanKeySeriesFromJson(json);

  Map<String, dynamic> toJson() => _$SanKeySeriesToJson(this);
}
